package omq.api;

import javax.xml.rpc.ServiceException;

public class OMQConnectionFactory 
{
	
	// default connection is SOAP if no OMQConnectionType is specified
	// default URL is within the SOAP
	public static OMQConnection getConnection(String username, String password, OMQQueueManager qmgr) throws ServiceException
	{
		return new OMQConnectionSOAP(username, password, qmgr);

	}
	
	// default connection is SOAP if no OMQConnectionType is specified
	// default URL is in parameter
	public static OMQConnection getConnection(String username, String password, String connectionURL, OMQQueueManager qmgr) throws ServiceException
	{
		return new OMQConnectionSOAP(username, password, connectionURL, qmgr);

	}
	
	public static OMQConnection getConnection(String username, String password, OMQConnectionType connectionType, OMQQueueManager qmgr) throws ServiceException
	{
		return new OMQConnectionSOAP(username, password, qmgr);
		
		//TODO implement when we build POX as well...
//		if (connectionType.getConnectionType().equals(OMQConnectionType.typeSOAP))
//		{
//			return new OMQConnectionSOAP(username, password, qmgr);
//		}
//		else
//		{
//			return new OMQConnectionSOAP(username, password, qmgr);
//		}
	}
	
	public static OMQConnection getConnection(String username, String password, String connectionURL, OMQConnectionType connectionType, OMQQueueManager qmgr) throws ServiceException
	{
		return new OMQConnectionSOAP(username, password, connectionURL, qmgr);
		
		//TODO implement when we build POX as well...
//		if (connectionType.getConnectionType().equals(OMQConnectionType.typeSOAP))
//		{
//			return new OMQConnectionSOAP(username, password, qmgr);
//		}
//		else
//		{
//			return new OMQConnectionSOAP(username, password, qmgr);
//		}
	}
}
